#ifndef _PARTHUS_TEST_SYS_
#define _PARTHUS_TEST_SYS_

/******************************************************************************
 * MODULE NAME:    test_sys.h
 * PROJECT CODE:    BlueStream
 * DESCRIPTION:    System Test Definitions.
 * MAINTAINER:     Daire McNamara
 * CREATION DATE:  06 July 1999
 *
 * SOURCE CONTROL: $Id: test_sys.h,v 1.1 2008/02/03 09:39:38 james Exp $
 *
 * LICENSE:
 *     This source code is copyright (c) 1999-2004 Ceva Inc.
 *     All rights reserved.
 *
 ******************************************************************************/

#include "sys_types.h"
#include <stdio.h> 
typedef boolean t_test;

#ifdef NDEBUG
#error NDEBUG is defined, please ensure that NDEBUG is not defined!!!!
#endif 

#ifdef NO_STOP_ON_ASSERT_FAIL
#undef assert
#define assert(p) ((p) ? (void)0 : (void) printf("Error>>> assertion failed: %s, file %s, line %d\n", #p, __FILE__, __LINE__) );
#endif

#ifndef XStr
    /*
     * the following 2 macros allow the expansion of a (numeric) macro
     * as a quoted string (used for __COMPILER_VERSION__ and missing in Wasabi)
     */
    #define Str(x) #x
    #define XStr(x) Str(x)
#endif

#define TEST_SUMMARY_FILE stdout
#define REFERENCE_DIR "reference_test/"
#define RESULTS_DIR "results_test/"
#define REMOTE_DEVICE_INDEX 1
#define REMOTE_DEVICE_AM_ADDR 1

typedef enum { NO, YES } t_yes_no ;

typedef struct _mask {
  int HWE2E_master ;
  int HWE2E_slave  ;
  int HWL ;
  int SWE2E_master ;
  int SWE2E_slave  ;
  int SWL ;
} t_mask ;

/*
 * A standard test structure for all harnesses
 */
typedef struct _test {
  int  number ;                          /* Test Number                     */
  char const *descr ;                    /* Test Description                */
  t_test  (*execute)(const struct _test *tst); /* Test Harness for this test      */
  t_mask  active ;
  FILE *fReference ;                     /* Expected Results if appropriate */
  FILE *fResult ;                        /* Log File for this test          */
  t_packet packet_type;
  } t_Harness ;

/* Test Types                                                           */

/* External test declarations:  definitions in test_harness.c		*/

extern char *testNames[];

/* Useful test macro:          definitions in test_harness.c for now   */
#define prBinary(n) \
 {int i; for(i=sizeof(n)*8-1; i>=0; i--) putchar( '0'+(((n)&(1L<<i))!=0) ); }
#define prBinaryNL(n)   { prBinary(n); putchar('\n'); }


/*
 * Backwards compatibility with older stacks (target removal)
 */
#ifndef PRH_BS_CFG_SYS_MAX_LMP_OUT_MESSAGES
#define PRH_BS_CFG_SYS_MAX_LMP_OUT_MESSAGES PRH_BS_CFG_SYS_MAX_LMP_OUT_HEADERS
#endif

#ifndef PRH_BS_CFG_SYS_SIZEOF_LMP_OUT_HEAP
#define PRH_BS_CFG_SYS_SIZEOF_LMP_OUT_HEAP PRH_BS_CFG_SYS_SIZE_LMP_OUT_HEAP
#endif
 
#ifndef PRH_BS_CFG_BYTE_3
#define PRH_BS_CFG_BYTE_3 0
#endif

#ifndef PRH_BS_CFG_BYTE_4
#define PRH_BS_CFG_BYTE_4 0
#endif

#ifndef PRH_BS_CFG_BYTE_5
#define PRH_BS_CFG_BYTE_5 0
#endif

#ifndef PRH_BS_CFG_BYTE_6
#define PRH_BS_CFG_BYTE_6 0
#endif

#ifndef PRH_BS_CFG_BYTE_7
#define PRH_BS_CFG_BYTE_7 0
#endif

#endif

